home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / ALTD201A.ZIP / VB4016.ZIP / VB40.16 / EX26VB.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-04-19  |  4.5 KB  |  162 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "VB Example 26"
  4.    ClientHeight    =   4785
  5.    ClientLeft      =   1410
  6.    ClientTop       =   735
  7.    ClientWidth     =   3750
  8.    Height          =   5190
  9.    Left            =   1350
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4785
  12.    ScaleWidth      =   3750
  13.    Top             =   390
  14.    Width           =   3870
  15.    Begin VB.CommandButton About 
  16.       Caption         =   "About"
  17.       Height          =   495
  18.       Left            =   240
  19.       TabIndex        =   7
  20.       Top             =   3960
  21.       Width           =   1455
  22.    End
  23.    Begin VB.CommandButton Extract 
  24.       Caption         =   "Extract"
  25.       Height          =   495
  26.       Left            =   240
  27.       TabIndex        =   6
  28.       Top             =   3360
  29.       Width           =   1455
  30.    End
  31.    Begin VB.CommandButton Delete 
  32.       Caption         =   "Delete"
  33.       Height          =   495
  34.       Left            =   2040
  35.       TabIndex        =   5
  36.       Top             =   3360
  37.       Width           =   1335
  38.    End
  39.    Begin VB.CommandButton Command1 
  40.       Caption         =   "Exit"
  41.       Height          =   495
  42.       Left            =   2040
  43.       TabIndex        =   4
  44.       Top             =   3960
  45.       Width           =   1335
  46.    End
  47.    Begin VB.ListBox List1 
  48.       Height          =   2205
  49.       Left            =   2040
  50.       MultiSelect     =   2  'Extended
  51.       TabIndex        =   1
  52.       Top             =   240
  53.       Width           =   1335
  54.    End
  55.    Begin VB.FileListBox File1 
  56.       Height          =   2205
  57.       Left            =   240
  58.       Pattern         =   "*.zip"
  59.       TabIndex        =   0
  60.       Top             =   240
  61.       Width           =   1455
  62.    End
  63.    Begin Threed.SSPanel SSPanel1 
  64.       Height          =   375
  65.       Left            =   480
  66.       TabIndex        =   3
  67.       Top             =   2520
  68.       Width           =   2655
  69.       _version        =   65536
  70.       _extentx        =   4683
  71.       _extenty        =   661
  72.       _stockprops     =   15
  73.       caption         =   "SSPanel1"
  74.       backcolor       =   12632256
  75.       floodtype       =   1
  76.    End
  77.    Begin VB.TextBox JobProgress 
  78.       Height          =   375
  79.       Left            =   480
  80.       TabIndex        =   2
  81.       Text            =   "Job Progress -I'm invisible, dude"
  82.       Top             =   2880
  83.       Visible         =   0   'False
  84.       Width           =   2655
  85.    End
  86. Attribute VB_Name = "Form1"
  87. Attribute VB_Creatable = False
  88. Attribute VB_Exposed = False
  89. Option Explicit
  90. Dim z() As ALZipDir
  91. Dim LibraryHandle As Long
  92. Private Sub About_Click()
  93.   frmAbout.Text1 = "EX26VB demonstrates the simplified interface.  Double click on a"
  94.   frmAbout.Text1 = frmAbout.Text1 + " zip file to display its contents.  You can either"
  95.   frmAbout.Text1 = frmAbout.Text1 + " extract or delete the file from the archive."
  96.   frmAbout.Show 1
  97. End Sub
  98. Private Sub Command1_Click()
  99.     Unload Form1
  100.     End
  101. End Sub
  102. Private Sub Delete_Click()
  103.     Dim i As Integer
  104.     Delete.Enabled = 0
  105.     i = 0
  106.     While z(i).size <> -1
  107.         If List1.Selected(i) Then
  108.             z(i).mark = 1
  109.         Else
  110.             z(i).mark = 0
  111.         End If
  112.         i = i + 1
  113.     Wend
  114.     Delete.Enabled = 1
  115.     i = ALDelete(z(), 0, 0, JobProgress.hWnd)
  116.     File1_Click
  117. End Sub
  118. Private Sub Extract_Click()
  119.     Dim i As Integer
  120.     Extract.Enabled = 0
  121.     i = 0
  122.     While z(i).size <> -1
  123.         If List1.Selected(i) Then
  124.             z(i).mark = 1
  125.         Else
  126.             z(i).mark = 0
  127.         End If
  128.         i = i + 1
  129.     Wend
  130.     i = ALExtract(z(), 0, 0, 0, JobProgress.hWnd)
  131.     Extract.Enabled = 1
  132. End Sub
  133. Private Sub File1_Click()
  134.   Dim i As Integer
  135.   Dim count As Integer
  136.   Dim error As Integer
  137.   i = UBound(z, 1)
  138.   If z(i).compressed_size <> 0 Then ALFreeDir z
  139.   ALReadDir z(), File1.filename, count, error
  140.   List1.Clear
  141.   For i = 0 To count - 1
  142.     List1.AddItem z(i).name
  143.   Next
  144. End Sub
  145. Private Sub Form_Load()
  146.   File1.Path = App.Path
  147.   ChDrive App.Path
  148.   ChDir App.Path
  149.   LibraryHandle = LoadLibrary(DLLName)
  150.   If LibraryHandle < 32 Then
  151.     SSPanel1.Caption = "***ERROR LOADING " + DLLName + "***"
  152.     SSPanel1.FloodType = 0
  153.   End If
  154.   ReDim z(1)
  155. End Sub
  156. Private Sub Form_Unload(Cancel As Integer)
  157.   FreeLibrary (LibraryHandle)
  158. End Sub
  159. Private Sub JobProgress_Change()
  160.   SSPanel1.FloodPercent = Val(JobProgress.text)
  161. End Sub
  162.